package com.yuyue.springFramework.note11.entity.custom2;

import org.springframework.stereotype.Component;

/**
 * 用户注册成功后发送邮件事件
 */
@Component
public class SendEmailOnUserRegisterSuccessListener implements EventListener<UserRegisterSuccessEvent> {

    /**
     * 处理事件
     * @param event 处理的事件类型
     */
    @Override
    public void onEvent(UserRegisterSuccessEvent event) {
        System.out.println( String.format("给用户【%s】发送注册成功邮件!", event.getName()));
    }
}
